package com.baosight.risk.mapper.xtzy;

import java.util.List;
import java.util.Map;

import com.baosight.risk.service.xtzy.vo.XtzyUserVO;
import org.apache.ibatis.annotations.Param;

import com.baosight.risk.base.mapper.BaseMapper;
import com.baosight.risk.service.xtzy.entity.XtzyRoleUser;

public interface XtzyRoleUserMapper extends BaseMapper<XtzyRoleUser> {

    Integer deleteByUserId(@Param("userId") String userId);

    List<XtzyUserVO> selectRoleByUserCode(@Param("userCode") String userCode);

    Integer getXtzyRoleIdByUserId(@Param("userId") String userId);

    List<XtzyRoleUser> getRoleByCompId(@Param("compId") String compId);

    List<XtzyRoleUser> getRoleByCompIdAndUserId(@Param("compId") String compId, @Param("userId") String userId);

    List<XtzyRoleUser>  getRoleByCompIdAndRole(@Param("compId") String compId, @Param("roleCodes")List<String> roleCodes);


    /**根据roleKey查询
     * @author HXJ
     * @Date 2021/04/28 15:48
     * @description
     * @param roleKeys
     * @return java.util.List<com.baosight.risk.service.xtzy.entity.XtzyRoleUser>
     **/
    List<XtzyRoleUser> selectAllByRoleKey(@Param("roleKeys")String[] roleKeys);


    List<XtzyRoleUser> getByCompIdAndRoleId(@Param("compId") String compId, @Param("roleId") String roleId);

    Integer deleteByCompIdAndRoleId(@Param("compId") String compId, @Param("roleId") String roleId);

    Integer deleteByCompIdAndUserId(@Param("compId") String compId, @Param("userId") String userId);

    Integer deleteByCompIdAndUserCode(@Param("compId") String compId, @Param("userCode") String userCode);

    List<XtzyRoleUser> selectByUserCode(@Param("user") XtzyRoleUser user, @Param("deptList") List<String> deptList);

    List<Map> selectEmailData(@Param("loginName") String loginName);

    List<Map> queryByUser(@Param("param") Map<String, Object> param);

    Integer getCountByUserCodeAndRoleCode(@Param("userCode") String userCode);
    
    List<Map> selectSendMailUser();


}